<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>箭头函数</title>
</head>
<body>

</body>
<script>

    var foo = function (num1,num2) {
        console.log(num1+num2);
    }

    var foo1 = (num1,num2)=> console.log(num1+num2);
    var foo2 = (num1,num2) =>{
          ///
    }

    /**
     *
     * this关键字
     *     箭头函数的不存在this
     *     this指向 上一层所在的环境
     * */


     window.outter = "全局变量";

     function foo45() {

         let that = this;

         let inner = "foo45 内部内容";

         let innerObj = {

               innerFoo1:function () {

                     console.log(this==that); // this  innerFoo1 ; that foo45
               },
               innerArrow:()=>{
                    console.log(this==that); // this foo45  ; that foo45
               }
         }

          innerObj.innerFoo1();
          innerObj.innerArrow();

     }


     foo45();

</script>
</html>